// 验证模块
const Joi = require('joi');
// 房间模块
const {
    Room
} = require('../../../model/Room');

module.exports = async (req, res) => {
    const tag = req.params['tag'];
    if (tag) {
        // 查询房间信息
        const room = await Room.findOne({
            tag
        });
        // 响应
        if (room) {
            return res.sendResult(room, 200, '获取房间信息成功');
        } else {
            return res.sendResult(null, 400, '房间不存在');
        }
    } else {
        return res.sendResult(null, 400, '参数不正确');
    }
};